Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for script based drep on update certificate #884

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

CarlosLopezDeLara
Copy link
Contributor

@CarlosLopezDeLara CarlosLopezDeLara commented Sep 5, 2024

Changelog

- description: |
    add support for script based drep on update certificate: --drep-script-hash HASH
# uncomment types applicable to the change:
  type:
   - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Resolves #880

How to trust this PR

Now we have the ability to supply a script hash

cardano-cli conway governance drep update-certificate \
--drep-script-hash 8f33600845940d65bdbc7ea7a247a7997aa8558649128fa82c4c0468 \
--drep-metadata-url https://github.com/raw/cardano-foundation/CIPs/master/CIP-0119/examples/drep.jsonld \
--drep-metadata-hash fecc1773db89b45557d82e07719c275f6877a6cadfd2469f4dc5a7df5b38b4a4 \
--out-file drep-update.cert

It produces the certificate:

{
    "type": "CertificateConway",
    "description": "DRep Update Certificate",
    "cborHex": "83128201581c8f33600845940d65bdbc7ea7a247a7997aa8558649128fa82c4c046882785e68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f63617264616e6f2d666f756e646174696f6e2f434950732f6d61737465722f4349502d303131392f6578616d706c65732f647265702e6a736f6e6c645820fecc1773db89b45557d82e07719c275f6877a6cadfd2469f4dc5a7df5b38b4a4"
}

And if we pass the cborHex over the diagnostics mode on cbor.me we see it complies with the cddl

update_drep_cert = (18, drep_credential, anchor / nil)
drep_credential = credential
credential = [0, addr_keyhash // 1, scripthash]
[18, [1, h'8F33600845940D65BDBC7EA7A247A7997AA8558649128FA82C4C0468'], ["https://github.com/raw/cardano-foundation/CIPs/master/CIP-0119/examples/drep.jsonld", h'FECC1773DB89B45557D82E07719C275F6877A6CADFD2469F4DC5A7DF5B38B4A4']]

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@CarlosLopezDeLara CarlosLopezDeLara added this pull request to the merge queue Sep 6, 2024
Merged via the queue into main with commit e90cf44 Sep 6, 2024
25 checks passed
@CarlosLopezDeLara CarlosLopezDeLara deleted the drepupdatecert branch September 6, 2024 12:58
@@ -7003,7 +7003,8 @@ Usage: cardano-cli conway governance drep retirement-certificate
Create a DRep retirement certificate.

Usage: cardano-cli conway governance drep update-certificate
( --drep-verification-key STRING
( --drep-script-hash HASH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CarlosLopezDeLara adding the new option on the command line to the PR description is useful because this then automatically ends up in the changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] - allow update drep cert via CLI for scripts
4 participants